package cn.hh.lambda;

import org.junit.Test;

/**
 * @Author huangh
 * @date 2021/09/23
 * @Description:
 */
public class Demo3 {

    /**jdk8 没有lambda这么写**/
    @Test
    public void test1() {
        new MyThread2(new MyRunnable() {
            @Override
            public void run() {
                System.out.println("不用买票");
                System.out.println("骑电瓶车...");
            }
        }).start();
    }

    @Test
    public void test2(){
        new MyThread2(() -> {
            System.out.println("不用买票");
            System.out.println("骑电瓶车...");
        }).start();
    }


}
